package com.qf.bank.userinfoapi.api;

import com.qf.bank.userinfoapi.fallback.UserInfoApiError;
import com.qf.bank.userinfoapi.po.UserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author 乔-wlyjh
 * @date 2019/12/6 19:07
 */
@FeignClient(value = "userInfo-provider", fallback = UserInfoApiError.class)
public interface UserInfoApi {
//    分页
//    @RequestMapping(value = "/", method = RequestMethod.GET)
//    public IPage<UserInfo> page(@RequestParam int current, @RequestParam int size);
    //    查詢所有用戶信息
    @RequestMapping(value = "all/findAll",method = RequestMethod.GET)
    public List findAll();
    //查询一个用户信息
    @RequestMapping(value = "/userinfoId",method = RequestMethod.GET)
    public UserInfo findOne(@RequestParam int userinfoId);
    //    刪除用戶信息
    @RequestMapping(value = "/userinfoId",method = RequestMethod.DELETE)
    public boolean deleteById(int userinfoId);
    //xiu修改
    @RequestMapping(value = "upuserinfo",method = RequestMethod.PUT)
    public boolean update(@RequestBody UserInfo userInfo);
    //增加
    @RequestMapping(value = "/insertuserinfo",method = RequestMethod.POST)
    public UserInfo insert(@RequestBody UserInfo userInfo);

}
